package edu.gu.hajo.gcl.cmd.impl;

import edu.gu.hajo.gcl.exception.ExecException;
import edu.gu.hajo.gcl.interp.IInterpreter;

/**
 * The == operator
 * @author hajo
 *
 */
public final class EqOpCmd extends AbstractCmd  {
	
	public EqOpCmd(IInterpreter interp) {
		super(interp);
	}

	@Override
	public void execute() {
		if (args.size() != 2) {
			throw new ExecException("== : Wrong # args");
		}
		boolean result = Integer.parseInt(args.get(0)) == Integer.parseInt(args
				.get(1));
		interp.setResult(String.valueOf(result));
	}
}
